package com.作业.第八章作业.HomeWork08;

public class main {
    public static void main(String[] args) {
        SavingAccount s1 = new SavingAccount(1000);
        s1.deposit(100);//不扣手续费+100，count--，count = 2
        s1.deposit(100);//不扣手续费+100，count--，count =1
        s1.deposit(100);//不扣手续费+100，count--，count =0
        System.out.println(s1.getBalance()); //1300
        s1.deposit(100);//扣手续费， 余额  = 1300 + 100 - 1= 1399
        s1.deposit(100);////扣手续费 余额= 1399 + 100 - 1= 1498
        s1.deposit(100);//扣手续费 余额 1498 + 100 - 1 = 1597
        System.out.println(s1.getBalance());//1597
        s1.withdraw(100);//扣手续费， 余额 1597 - 100 -1= 1496
        s1.withdraw(100);//扣手续费， 余额 1496 - 100 -1= 1395
        s1.withdraw(100);//扣手续费， 余额 1395 - 100 -1= 1294
        System.out.println(s1.getBalance());  //1294

        s1.earnMonthInterest();  //新的月计数器count清零
        s1.deposit(100); //不扣手续费  余额 1294 +100 = 1394
        s1.deposit(100);//不扣手续费  余额 1394 +100 = 1494
        s1.deposit(100);//不扣手续费  余额 1494 +100 = 1594
        System.out.println(s1.getBalance());
    }
}
